<template>
  <h3>Home 😊</h3>
  <p>
    <span>Smiles Count: {{ smile_count }}</span> <button @click="smile_count++">+</button>
  </p>
</template>

<script>
export default {
  name: 'navi-home',
  data() {
    return {
      smile_count: 1
    }
  },
  unmounted() {
    console.log('Home组件被切换,数据不被保存，丢失')
  },
  deactivated() {
    console.log('使用<keepAlive>标签后可以看见此消息，Home组件数据不会丢失')
  }
}
</script>
